#include <iostream>
using std::cout;
using std::endl;
class A
{
public:
    void print() const{
        /* cout << "A::print():" << _a  << endl; */
        cout << "A::print():"  << endl;
    }
    double _a = 10.1;
};

class B
: virtual public A
{
public:
    double _b;
};

class C
: virtual public A
{
public:
    double _c;
};

class D
: public B
, public C
{
public:
    /* void print() const{ */
    /*     cout << "D::print()"  << endl; */
    /* } */
    double _d;
};

void test0(){
    cout << sizeof(A) << endl;
    cout << sizeof(B) << endl;
    cout << sizeof(C) << endl;
    cout << sizeof(D) << endl;

    D d;
    d.print();
    d.A::print();
    d.B::print();
    d.C::print();
}

int main(void){
    test0();
    return 0;
}
